Skip to content

Close batch pipeline after a query error#2391

Merged
jackc merged 1 commit into
jackc:masterfrom
bonnefoa:pipeline-close-error
Oct 4, 2025
Merged

Close batch pipeline after a query error#2391
jackc merged 1 commit into
jackc:masterfrom
bonnefoa:pipeline-close-error

Conversation

@bonnefoa

Copy link
Copy Markdown
Contributor

Currently, if a batch ends with a statement_timeout on a br.Query(), the next br.Close() will only return the query error and leave the underlying pipeline opened. This prevents the connection from being reused and a second br.Close() is required to really close the pipeline.

This patch changes br.Close() to fallthrough and close the pipeline, even with a lastRow error present.

@bonnefoa bonnefoa force-pushed the pipeline-close-error branch from 8d0a39f to 75d3e97 Compare September 26, 2025 08:02
Currently, if a batch ends with a statement_timeout on a br.Query(),
the next br.Close() will only return the query error and leave the
underlying pipeline opened. This prevents the connection from being
reused and a second br.Close() is required to really close the pipeline.

This patch changes br.Close() to fallthrough and close the pipeline,
even with a lastRow error present.
@bonnefoa bonnefoa force-pushed the pipeline-close-error branch from 75d3e97 to 452f07b Compare September 29, 2025 06:30
@jackc jackc merged commit eb1d23a into jackc:master Oct 4, 2025
14 checks passed
@jackc

jackc commented Oct 4, 2025

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants